Connecting from FlashAir to Amazon AWS 1 (Preparation)

Latest update: October 2018

In this tutorial we will explain how to send the data saved in FlashAir directly to AWS via the Internet.

Overview

AWS(Amazon Web Services) is a web service provided by Amazon. It is a large-scale cloud service that can allow projects to quickly start at a low cost because it is a pay-as-you-go service. It keeps the latest security status, and offers an abundant amount of services.
It's currently being used not only by individual users but also for many corporate users.

In this tutorial, we will explain the method of taking a photo of a person from a fixed point using a motion detection camera, writing it to FlashAir, and then uploading it directly to AWS using a Lua script. In addition, we will explain how to judge age, sex and so on from a photograph taken as an application by AI and visualize it with the BI tool.

Please begin by referring to the sample source and concrete examples. These examples are especially useful for those who want to perform advanced processing on data written to FlashAir from cameras, sensors, etc, want to save in a secure environment and share it, or who were looking for new use of AWS.

Benefits of connecting FlashAir to AWS

  • It will be possible to initilize an IoT system that transmits data directly from the edge device (FlashAir) to the cloud (AWS).
  • AWS can provide supplemental computation power to help with various compute processing that may be difficult with just FlashAir alone.
  • If you are already using AWS, you can combine FlashAir with your existing workflow.

Things to prepare

FlashAir W-0416G Reference price:¥5,918
Please use FW 4.00.03 or later.
Raspberry Pi 3Starter kit Amazon reference price:¥5,480
It is used to supply power to FlashAir, process shooting interval, and reload FlashAir.
WebcamLOGICOOL C270 Reference price:¥2,551
It is used for shooting.
USB card reader
Please use something compatible with SD card. It is used to add and modify Lua script.
Credit card
It is necessary at the time of AWS contract.

ReferenceThe cost of AWS necessary for this tutorial (region: Asia Pacific (Tokyo)) is about 233 yen / year (as of October 2018). You can use the free usage frame for the first 12 months after you register your account.

Reference total price: ¥ 13,949 (as of October 2018)

Overall flow

  1. Raspberry Pi 3 + Webcam
    Used for supplying power to FlashAir, taking pictures, reloading FlashAir. Connect Raspberry Pi and webcam and install "Motion" application for motion detection. Please complete initial setting of Raspberry Pi, installation of application.
    This time we use Raspberry Pi and webcam to reduce hardware cost, but you can do the same if FlashAir in your camera is always powered. (In that case FlashAir will not be reloaded)
  2. FlashAir + Lua script
    Save the captured image to FlashAir, connect to AWS using Lua script, and upload the image.
  3. Amazon S3
    Amazon S3(Amazon Simple Storage Service) is a storage service for the Internet. Images and analysis results taken by the camera and store it in a bucket (container) in the S3.
  4. AWS Lambda
    AWS Lambda is a computing service that can execute code in response to data changes in S3 and other AWS storage. Lambda writes application code in Lambda beforehand and Lambda detects that a file has been added to S3 and calls Rekognition face recognition processing. After acquiring Rekognition's analysis process, store the analysis result in the result bucket in S3.
  5. Amazon Rekognition
    Amazon Rekognition is an image recognition service. It judges age and sex from the photographed image and returns the analysis result to Lambda.
  6. Amazon QuickSight
    Amazon QuickSight is a business intelligence service that supports files, AWS data sources, external databases. You can visualize and share analysis results in S3 from abundant templates.

In the execution section, let's actually run from creating AWS account to creating bucket, uploading image from FlashAir. Sample code can also be obtained in the execution edition.